<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AutoReply extends Model
{
    const MSG_TEXT        = 'text';
    const MSG_LINK        = 'link';
    const MSG_EVENT       = 'event';
    const MSG_IMAGE       = 'image';
    const MSG_VOICE       = 'voice';
    const MSG_VIDEO       = 'video';
    const MSG_LOCATION    = 'location';
    const MSG_SHORT_VIDEO = 'shortvideo';

    /**
     * 消息推送类型
     * @var array
     */
    public static $msgTypesMap = [
        self::MSG_TEXT        => '文本消息',
        self::MSG_LINK        => '链接消息',
        self::MSG_EVENT       => '事件',
        self::MSG_IMAGE       => '图片消息',
        self::MSG_VOICE       => '语音消息',
        self::MSG_VIDEO       => '视频消息',
        self::MSG_LOCATION    => '地理位置消息',
        self::MSG_SHORT_VIDEO => '小视频消息',

    ];

    const REPLY_NEWS  = 'news';
    const REPLY_TEXT  = 'text';
    const REPLY_IMAGE = 'image';

    public static $replyMsgTypesMap = [
        self::REPLY_NEWS  => '图文消息',
        self::REPLY_TEXT  => '文本消息',
        self::REPLY_IMAGE => '图片消息',
    ];

    public function material()
    {
        return $this->belongsTo(Material::class, 'material_id');
    }
}
